package com.hxrfid.project.domain.bo;

import com.hxrfid.common.core.domain.BaseEntity;
import com.hxrfid.common.core.validate.AddGroup;
import com.hxrfid.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 商品管理业务对象 bs_product
 *
 * @author hxrfid
 * @date 2025-06-12
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class BsProductBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 商品类别（1商品，2非遗）
     */
    @NotBlank(message = "商品类别（1商品，2非遗）不能为空", groups = { AddGroup.class, EditGroup.class })
    private String productType;

    /**
     * 商品标题
     */
    @NotBlank(message = "商品标题不能为空", groups = { AddGroup.class, EditGroup.class })
    private String title;

    /**
     * 商品主图
     */
    @NotBlank(message = "商品主图不能为空", groups = { AddGroup.class, EditGroup.class })
    private String mainImage;

    /**
     * 商品轮播图
     */
    @NotBlank(message = "商品轮播图不能为空", groups = { AddGroup.class, EditGroup.class })
    private String cyclePath;

    /**
     * 价格
     */
    @NotNull(message = "价格不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal price;

    /**
     * 下划价
     */
    @NotNull(message = "下划价不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal underlinePrice;

    /**
     * 单位
     */
    @NotBlank(message = "单位不能为空", groups = { AddGroup.class, EditGroup.class })
    private String unit;

    /**
     * 服务
     */
    private String service;

    /**
     * 库存
     */
    @NotNull(message = "库存不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long inventory;

    /**
     * 销量
     */
    private Long saleNum;

    /**
     * 商品详情
     */
    @NotBlank(message = "商品详情不能为空", groups = { AddGroup.class, EditGroup.class })
    private String productDesc;

    /**
     * 商品溯源
     */
    private String source;

    /**
     * 商品授权
     */
    private String credential;

    /**
     * 品牌id
     */
    private Long brandId;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 区域id
     */
    @NotNull(message = "区域id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long areaId;

    /**
     * 区域
     */
    @NotBlank(message = "区域不能为空", groups = { AddGroup.class, EditGroup.class })
    private String area;

    /**
     * 详细区域
     */
    @NotBlank(message = "详细区域不能为空", groups = { AddGroup.class, EditGroup.class })
    private String areaAddr;

    /**
     * 是否限时特价（1是0否）
     */
    private String isSpecial;

    /**
     * 是否新品推荐（1是0否）
     */
    private String isNew;

    /**
     * 是否爆品推荐（1是0否）
     */
    private String isHot;

    /**
     * 是否可用积分（1是0否）
     */
    private String isScore;

    /**
     * 备注
     */
    private String remark;

    /**
     * 排序字段(销量saleNum;价格price;默认综合排序)
     */
    private String sortParam;

    /**
     * 倒序还是正序排列(倒序desc；默认正序)
     */
    private String sortRule;

}
